feat!: adopt mod-utils v6 (mod-blocks v2)#147
Merged
Conversation
Extend the placeholder exampleSite so every Bookshop component is rendered (and therefore validated by the argument engine) in CI: one content page per component, demo blog posts and team members for the page-driven components, a releases data file, a demo contact-form hook, and a Hinode import that provides the shared partials the components call at site build time. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bump the module path to github.com/gethinode/mod-blocks/v2 and require mod-utils v6.0.1. Migrate all 26 InitArgs call sites (19 Bookshop component wrappers and 7 layout partials) to the Args API with the strict-false guardrail for site-authored content. Remove fallbacks that v6 defaulting makes dead (illustration and heading widths, device, cols, contact width, legacy link_type chain) and fix the faq section component-name typo (faw). BREAKING CHANGE: requires github.com/gethinode/mod-blocks/v2 import path; adopts mod-utils v6 and migrates argument handling to the Args API (see gethinode/mod-utils v5-to-v6 migration notes). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
🎉 This PR is included in version 2.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopts the mod-utils v6 validation engine as mod-blocks v2, per the adoption program (gethinode/mod-utils#334 and the v5-to-v6 migration notes in the mod-utils README).
Path bump
go.mod:module github.com/gethinode/mod-blocks/v2, requiresgithub.com/gethinode/mod-utils/v6 v6.0.1(contains the camelKey-collision fix; never v6.0.0)config.tomlandexampleSite/hugo.tomlimport paths updated; README install snippet updatedmod-blocks.workworkspace)ExampleSite seeding (commit 1)
The exampleSite was a single placeholder page, so the argument engine validated nothing in CI. It now renders all 19 Bookshop components (one page per component under
/components/, plus a hero on the home page), backed by demo blog posts, team members, a releases data file, a demo contact-form hook, and a Hinode import that provides the shared partials the components call at build time. Hinode v2.20.0 pins mod-utils/v5, but Hugo collects a single mod-utils module for the site and mod-blocks imports first, so the whole exampleSite runs on the v6 engine — the intended Hinode v3 endstate preview.Migrated call sites (26 = every InitArgs/InitTypes site, commit 2)
component-library/components/*/*.hugo.html): validation-onlyInitArgs→Args.htmlwith"strict" false(CloudCannon/site-authored content);contact-form,list, andseparatoralso readhook/id/clearfrom the$result.argsenvelopeutilities/section.html,assets/hero.html,assets/contact.html,assets/faq.html,assets/menu.html,assets/preview.html,assets/testimonial-carousel.html):Args.html+ separated envelope,"strict" false(all receive site-authored content forwarded by the wrappers)Call-site fixes carried by this generation
assets/menu.html: legacy$args.defaultdefaulted-list read → the envelope's$result.defaultedassets/hero.html: removed the deador $args.linkType $args.link_type $args.typechain (onlylinkTypeexists in the envelope) and the deador $args.heading.width 8(v6 fills nested defaults)assets/contact.html(or $args.width 12),assets/preview.html(device | default "desktop"),assets/testimonial-carousel.html(cols | default 1): dead fallbacks removed, engine defaults applyfaq.hugo.html: sectioncomponent-nametypofaw→faq(section class andparams.modules.blocks.faqlookup were broken)Verification
hugo mod graph:mod-utils/v6@v6.0.1only; exampleSite graph contains nomod-utils/v5pnpm build: exit 0, zero ERROR lines (before and after)components/about,components/featured) — intended:illustration.widthdefault 8 now applies to the omitted nested member, so the hero image wrapper gainscol-8and itssizeshint shrinksillustration.width/heading.widthnested defaults now applying (hinode's section-title switchesw-100→col-12 col-md-8on the flipped engine), thefaw→faqfix, and pre-existing per-build md5 id churn (ids derive fromnow)Warning triage (build log, all non-blocking)
[testimonials] testimonials[N]: unsupported attribute 'icon'— structure gap: the sharedtestimonialstype in mod-utils_types.ymllacksicon, yet the blueprint declares it andassets/testimonial-carousel.htmlrenders it. Flagged for maintainer; YAML deliberately untouched.[video-message] video: unsupported attribute 'media_id'— structure gap: the sharedvideotype declaresid, while the blueprint and the wrapper usemedia_id/media-id. Flagged for maintainer; YAML deliberately untouched.[script] state '',[image-definition] priority '',[hero-image] justify '',[bundle] modules []interface{}— hinode v2.20.0 internal call sites surfaced by the flipped v6 engine; hinode is out of scope for this program (wave 4 / Hinode v3).Mixing this module into a site whose theme still pins mod-utils v5 flips that site's engine to v6 the same way (Hugo collects one mod-utils; first import wins) — release notes must call this out.
🤖 Generated with Claude Code